package com.seven.commons;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;

import java.util.Collection;
import java.util.List;

/**
 * @projectname:common-utils
 * @author: sevenDay
 * @date: 2019/8/13 09:10
 * @desc: GuavaUtils相关的帮助类的封装
 */
public class GuavaUtils {

    public static String  StringJoin(Collection<?> collection, String separator){
        Joiner joiner =  Joiner.on(separator).skipNulls();
        return joiner.join(collection);
    }

    public static List<String> separatorString (String source,String separator){
        Splitter splitter = Splitter.on(separator).trimResults().omitEmptyStrings();
        return splitter.splitToList(source);
    }
}
